﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace NavmeshPathfinding
{
    class Mathf
    {
        public static float PI = (float)Math.PI;

        public static float sin(float radians)
        {
            return (float)Math.Sin(radians);
        }

        public static float cos(float radians)
        {
            return (float)Math.Cos(radians);
        }

        public static float max(float a, float b)
        {
            return Math.Max(a, b);
        }

        public static float min(float a, float b)
        {
            return Math.Min(a, b);
        }

        public static float abs(float x)
        {
            if (x < 0)
                return -1 * x;
            else
                return x;
        }

        public static bool isEqual(float a, float b)
        {
            return (abs(a - b) < EPSILON);
        }

        public static bool isEqual(Vector3 a, Vector3 b)
        {
            return isEqual(a.X, b.X) && isEqual(a.Y, b.Y) && isEqual(a.Z, b.Z);
        }

        public static float EPSILON = 0.00001f;
    }
}
